package cn.opopopo.design_pattern_learn.结构型.proxy;

public class RealVideoService implements VideoService {
    public RealVideoService() {
        loadVideoFromServer(); // 模拟耗时操作
    }

    private void loadVideoFromServer() {
        System.out.println("正在从服务器加载高清视频...（耗时操作）");
        try {
            Thread.sleep(2000); // 模拟延迟
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        System.out.println("视频加载完成！");
    }

    @Override
    public void playVideo(String videoName) {
        System.out.println("播放视频: " + videoName);
    }
}